import request from '@/utils/request'

// 上传文件
export const upload = (data: FormData) => {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

// 获取上传文件列表
export const getUploadList = () => {
  return request({
    url: '/upload/getUploadList',
    method: 'POST'
  })
}

// 根据ID获取上传文件信息
export const getUploadById = (data: { upload_id: number }) => {
  return request({
    url: '/upload/getUploadById',
    method: 'POST',
    data
  })
}

// 删除上传文件
export const deleteUpload = (data: { upload_id: number }) => {
  return request({
    url: '/upload/deleteUpload',
    method: 'POST',
    data
  })
}

// 批量删除上传文件
export const batchDeleteUpload = (data: { upload_ids: number[] }) => {
  return request({
    url: '/upload/batchDeleteUpload',
    method: 'POST',
    data
  })
}